Just-in-time hardware for field programmable gate arrays

ABSTRACT

A method for implementing a distributed hardware system includes retrieving a hardware design described in a hardware description language, where the hardware design includes a plurality of components. The method further includes, for each component of the hardware design, sending the component to a hardware compiler and to one of a plurality of software engines, where the hardware compiler compiles the component to run in one of a plurality of hardware engines and the one software engine simulates the component while the hardware compiler compiles the component for the one hardware engine, and upon completion of the compilation of the component, sending the compiled component to one of the hardware engines to be executed by the one hardware engine and monitoring communication so that the one hardware engine can interact with other components in other hardware engines or software engines.

BACKGROUND

Every year the semiconductor industry makes improvements in the size of a transistor and thus the number of transistors available on a semiconductor device of a given die area increases. However, the improved transistor density of the semiconductor device encounters a problem. As the transistor density increases, the device consumes more power and ultimately exceeds safe thermal limits for the given die area. Because the power consumed by the die is a direct function of clock speed, the power limit acts as a barrier that constrains the maximum clock speed and computing performance available from a single-threaded-general purpose processor. In response to this power barrier, processor architectures have incorporated parallelism in the form of multiple core processors. However, the power consumption problem remains even with multi-core processors, regardless of the multi-core architecture. In addition, the degree of parallelism achievable by multi-core architectures is limited and this limitation along with the power barrier becomes a significant source of “dark silicon,” i.e., unpowered silicon. In one study, the speedup of the system increased only by about a factor of eight although improved transistor density offered a potential performance increase by a factor of more than 32.

Clearly, the performance that is potentially available from improved transistor technology is not being realized by today's processing architectures. To extract more performance, alternatives to current processing architectures are needed. One alternative is the use of field programmable gate arrays (FPGAs). The performance of FPGA-implemented tasks or functions can easily exceed the performance of a general purpose processor by several orders of magnitude. However, design of an FPGA is a difficult and lengthy process. The process involves writing a design in a hardware description language (HDL), such as Verilog or VHDL, simulating the design, synthesizing the HDL design to a register transfer language (RTL), and then placing and routing the design for a specific type of FPGA. This process can take hours or even days. In addition, if and when the design is loaded onto the FPGA and the result does not function as expected or has an error, the entire process must be repeated to find the error

This design flow impedes the adoption of FPGA designs because the debug cycle is too long and the design is targeted to a specific type of FPGA. The long design cycles makes the use of different FPGAs difficult and almost rules out optimizing the design, as the optimization would take even more design cycles. Therefore, an improved design process is desirable to make FPGA development easier.

SUMMARY

One embodiment is a method for executing a runtime on one or more processors to implement a distributed hardware system. The method includes retrieving from storage a hardware design described in a hardware description language, where the hardware design includes a plurality of components. The method further includes, for each component of the hardware design, sending the component to a hardware compiler and to one of a plurality of software engines, where the hardware compiler compiles the component to run in one of a plurality of hardware engines and the one software engine simulates the component while the hardware compiler compiles the component for the one hardware engine, and upon completion of the compilation of the component, sending the compiled component to one of the hardware engines to be executed by the one hardware engine and monitoring communication so that the one hardware engine can interact with other components in other hardware engines or software engines.

Further embodiments of the present invention include a non-transitory computer-readable storage medium comprising instructions that cause a computer system to carry out one or more aspects of the above method, and a computer system configured to carry out one or more aspects of the above method.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a design of a number of functional modules to be loaded and executed on hardware such as an FPGA.

FIG. 2 depicts a parsing of the design in FIG. 1 to capture the hierarchy of functional modules in the design.

FIG. 3 depicts a physical distributed system that implements the hierarchical set of functional modules in the design of FIG. 2.

FIG. 4A depicts a system in which embodiments described herein may be practiced.

FIG. 4B depicts processing modules in a system used to develop and implement the design of FIG. 1 in one embodiment.

FIG. 5A depicts a flow chart for processing a design change in one embodiment.

FIG. 5B depicts a flow chart of the ParseCheck function in one embodiment.

FIG. 6A depicts a flow chart of an aspect of the dispatcher of the runtime system in FIG. 4B according to an embodiment.

FIG. 6B depicts a flow chart of another aspect of the dispatcher of the runtime system in FIG. 4B according to an embodiment.

FIG. 6C depicts a flow chart of yet another aspect of the dispatcher of the runtime system in FIG. 4B according to an embodiment.

FIG. 6D depicts a flow chart of yet another aspect of the dispatcher of the runtime system in FIG. 4B according to an embodiment.

FIG. 6E depicts the distributed system of FIG. 3 after fusions have occurred.

FIG. 7A depicts a flow chart of an aspect of the hardware compiler in the runtime system of FIG. 4B according to an embodiment.

FIG. 7B depicts a flow chart of another aspect of the hardware compiler in the runtime system of FIG. 4B according to an embodiment.

FIG. 8 depicts a flow chart of a hardware engine in the runtime system of FIG. 4B according to an embodiment.

FIG. 9 depicts a flow chart of one of the software engines runtime system of FIG. 4B according to an embodiment.

FIG. 10 depicts a time line in one embodiment for the activities of generator, dispatcher, hardware compiler, one of the software engines, one of the hardware engines and the engine monitors of FIG. 4B.

DETAILED DESCRIPTION

Embodiments disclosed herein include a process which combines a runtime, along with one or more software engines and one or more hardware engines to create just-in-time hardware for FPGAs.

FIG. 1 depicts a design 100 of a number of functional modules 102, 104, 106, 108, 110, 122 to be loaded and executed on hardware such as an FPGA. In FIG. 1, each of the functional modules 102, 104, 106, 108, 110, 122 can be independent or can include sub-modules, thus creating a hierarchy of modules. For example, module 104 includes two sub-modules 112 and 114, while module 106 includes sub-module 116 which further includes sub-module 118. Module 108 includes sub-module 120 and module 110 has no sub-modules. In addition, each of the functional modules 104, 106, 108, 110 has access to IO module 122 so that the module can communicate with items external to the functional modules, such as buttons, switches, lights, transducers and the like.

FIG. 2 depicts a parsing 200 of design 100 in FIG. 1 to capture the hierarchy of functional modules in the design. The root module in the hierarchy is module 102, which has sub-modules 104, 106, 108, 110, 116 and leaves 118, 112, 114, 120. In addition, each of the sub-modules is parsed into an abstract syntax tree to represent the design of the sub-module.

FIG. 3 depicts a physical distributed system 300 that implements the hierarchical set of functional modules 102, 104, 106, 108, 110, 112, 114, 116, 118, 120 in the design of FIG. 2. Thus, the design of FIG. 2 is realized in hardware as a distributed system comprising a set of components 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, each of which communicates with one or more other components.

FIG. 4A depicts a system 400 in which embodiments described herein may be practiced. System 400 includes a computer system 401 having one or more general or special purpose processors 402, 404, 406 coupled to which are a bus 405, main memory 408, a storage interface 410 that connects to storage 414, a user terminal interface 412 that connects to a user terminal 416 and an FPGA interface 418 for connecting to a bank of FPGAs.

FIG. 4B depicts processing modules in a system 450 used to develop and implement the design of FIG. 1 in one embodiment. System 450 includes computer system 401, such as the one described in FIG. 4A. Computer system 401 includes an FPGA interface 418 which connects to a bank 472 of FPGAs, which in turn is coupled to I/O 474. Also connected to the computer system 401 are a user terminal 416 and storage 414. In computer system 401, main memory 408 includes instructions, which when processed by one or more processors 402, 404, 406, execute a runtime 452. Runtime 452 includes a parser 454, a type checker 464, a generator 456, a dispatcher 458, a hardware compiler 478, a communications memory 460, engine monitors 462, one or more hardware engines 486, 488, 490 and one or more software engines 466, 468, 470.

Parser 454, type checker 464, generator 456 and dispatcher 458 are configured to receive user input from user terminal 416 or a request from dispatcher 458 and to generate and store a representation of a hardware design to be loaded into bank 472 of FPGAs.

Dispatcher 458, hardware compiler 478, communications memory 460, engine monitors 462, hardware engines 486, 488, 490 and software engines 466, 468, 470 are configured to execute and simulate a hardware design to be loaded into bank 472 of FPGAs. In particular, hardware compiler 478 places and routes the design, performs timing checks on the design and checks regarding the target FPGA into which the design is to be loaded. Each of the hardware engines 486, 488, 490 is configured to execute the placed and routed design of a component of the design. Each of the software engines 466, 468, 470 is configured to simulate a software version (HDL) of a component of the design. Communications memory 460 permits software engines 466, 468, 470, hardware engines 486, 488, 490, and FPGAs in bank 472 of FPGAs to communicate with each other by receiving messages from engine monitors 462.

FIG. 5A depicts a flow chart 500 for processing a design change in one embodiment. In step 502, upon receiving design input from the user, the runtime calls a function, ParseCheck 550, in step 504, which is further described in reference to FIG. 5B and in step 506 stores a representation of the distributed system 300 in FIG. 3 in storage 414. Alternatively, upon receiving a request to fuse a sub-tree of the design as depicted in FIG. 2 from dispatcher 458, runtime 452 stores the updated representation distributed system 300 in storage 414. The fusing of sub-trees is discussed further below.

FIG. 5B depicts a flow chart of the ParseCheck function 550 in one embodiment. Upon the function being called in FIG. 5A, parser 454 parses the design of FIG. 1 in step 552 into the representation depicted in FIG. 2. i.e., a tree of modules. If there is an error in the design input from the user, as determined in step 554, the user input is dropped and a notice is sent in step 562 to the user via terminal 416. Next, in step 566, type checker 464 in ParseCheck function 550 type checks each module of the design and if there is any error as determined in step 558, again the user input is dropped and a notice is sent in step 562 to the user via terminal 416. After parsing and type checking the design input, generator 456 in the ParseCheck function 550 generates a representation of the design as a set of components of distributed system 300 depicted in FIG. 3 and the function returns the representation in step 564.

FIG. 6A depicts a flow chart 600 of an aspect of dispatcher 458 of runtime system 452 in FIG. 4B according to an embodiment. In FIG. 6A, upon detecting in step 602 that one of the components of the stored representation of distributed system 300 has been changed, dispatcher 458 sends the changed component in step 604 to hardware compiler 478 and at the same time to one of the available software engines 466, 468, 470 in step 606. In addition, if one of the hardware engines 486, 488, 490 was running the component prior to the change, then dispatcher 458 sends in step 608 a stop notice to that hardware engine. Thus, one of the software engines 466, 468, 470 simulates the changed component while at the same time hardware compiler 478 compiles the changed component.

FIG. 6B depicts a flow chart 620 of another aspect of dispatcher 458 of runtime system 452 in FIG. 4B according to an embodiment. In FIG. 6B, when dispatcher 458 receives any message from hardware compiler 480 in step 622, it forwards in step 624 the message to the user via the user terminal 416. These messages inform the user of any errors detected by dispatcher 458 or hardware compiler 478 and which require user correction.

FIG. 6C depicts a flow chart 640 of yet another aspect of dispatcher 458 of runtime system 452 in FIG. 4B according to an embodiment. In FIG. 6C, when dispatcher 458 receives notice of completion from hardware compiler 478 in step 642, dispatcher 458 transfers the component in step 644 to one of the available hardware engines 486, 488, 490.

FIG. 6D depicts a flow chart 660 of yet another aspect of dispatcher 458 of runtime system 452 in FIG. 4B according to an embodiment. In FIG. 6D, when dispatcher 458 discovers that all of the components of a sub-tree of the design in FIG. 2 have meet a stability test in step 662, dispatcher 458 sends in step 664 a fuse message to generator 456. In one embodiment, the stability test determines that the components of a given sub-tree, say for example, components 104, 112, 114 in FIG. 2, have been running for a certain amount of time without requiring correction by the user and thus represent a stable design. The fuse message requests that generator 456 fuse the components of the sub-tree together to become a single component. This initiates a storage of the updated design as described in reference to FIG. 5A.

FIG. 6E depicts the distributed system 680 of FIG. 3 after fusions have occurred. In the figure, components 112 and 114 have been running for a predetermined amount of time without requiring correction by the user and thus meet a criterion for a stable design. So, components 112 and 114 are fused into component 104, which is now treated a single component. Similarly, components 116 and 118 have been fused into component 106 and component 120 is fused onto 108. Eventually, the entire design will be fused into a single component.

FIG. 7A depicts a flow chart 700 of an aspect of hardware compiler in runtime system 452 of FIG. 4B according to an embodiment. When the hardware compiler receives a component from dispatcher 458 in step 702, hardware compiler 478 performs a place and route in step 704, and a timing analysis in step 706 of the component. In one embodiment, the place and route and timing analysis conform to design flow of Quartus®. Also, in some embodiments, pre-compiled components are added to the component for communicating with the communication memory in the runtime and for interacting with any external devices, such as buttons, switches and transducers. In step 708, hardware compiler 478 compiles the component so that it can run on a hardware engine and in step 710, performs checks to ensure that the design of the component will operate in a target FPGA according to the constraints imposed by the particular FPGA. In step 712, hardware compiler 478 generates an appropriate bitstream for programming the targeted FPGA. The steps 704-712 are repeated for each component received from dispatcher 458.

FIG. 7B depicts a flow chart 750 of another aspect of the hardware compiler in the runtime system of FIG. 4B according to an embodiment. In FIG. 7B, when hardware compiler 478 completes a compilation of a component in step 752, hardware compiler 478 sends the previously generated bitstream for the component to the FPGA interface in step 754 and sets up an available hardware engine to execute the component in step 756. In step 758, hardware compiler 478 sends notice of completion to dispatcher 458 via path 480 in FIG. 4B.

FIG. 8 depicts a flow chart 800 of a hardware engine in runtime system 452 of FIG. 4B according to an embodiment. Upon transfer of a component to one of the hardware engines 486, 488, 490 in step 802, the hardware engine begins simulation of the component in step 804. If, in step 806, the hardware engine receives a stop notice from hardware compiler 458 via path 484, then the hardware engine ends execution of the component in step 810. Otherwise, it continues executing the component in step 808.

FIG. 9 depicts a flow chart 900 of one of the software engines 466, 468, 470 in runtime system 452 of FIG. 4B according to an embodiment. In step 902, when the software engine receives a component from dispatcher 458 or a stop notice from dispatcher 458 via path 486, it stops simulation of any current component it is simulating in step 904 If a new component was received, the software engine starts simulation of the just received component in step 906. While continuing simulation in step 912, it receives massages from communication memory in step 908 and sends messages to communications memory in step 920. This continues until dispatcher 458 sends a new component in step 902 for simulation.

FIG. 10 depicts a time line in one embodiment for the activities of generator 456, dispatcher 458, hardware compiler 478, one of the software engines 466, 468, 470, one of the hardware engines 486, 488, 490 and engine monitors 462 of FIG. 4B. At time t1, generator 456 generates components of a design or modified design in accordance with the steps of FIGS. 5A, 5B. At time t2, generator 456 stores the design or modified design in storage. At time t3, dispatcher 458 receives the modified design and at time t4 sends a modified component to the hardware compiler 478, to one of the software engines 466, 468, 470 and a notice to stop one of the hardware engines 486, 488, 490 currently simulating the component in accordance with the steps of FIG. 6A. A time t5, during the simulation of the component, one of the software engines 466, 468, 470 sends communication messages to one of the engine monitors 462 to communicate with other components of the design. At time t6, hardware compiler 478 indicates that the compilation of the component is completed. At time t7, hardware compiler 478 sends the bitstream for the component to FPGA interface 418 so that it can be downloaded into one or more FPGAs. At time t8, FPGA interface 418 sends messages to one of the monitoring engines 462 so that one or more of the FPGAs can communicate with other components of the design. At time t9, hardware compiler 478 notifies dispatcher 458 that the compilation of the component is complete. At time t10, dispatcher 458 sends the component to one of the available hardware engines 466, 468, 470 and, at time t11, stops simulation of the component in the software engine. At time t12, one of the hardware engines 486, 488, 490 running the component sends messages to one of the engine monitors 462 to communicate with the other components of the design. At time t13, dispatcher 458 notifies the user of a stable set of components and a request to fuse the set of components into a single component and, at time t14, sends the modified design to storage 414. The process then repeats until the entire design is fused into a single component.

Several advantages arise from the above described system. First, because components of the design can reside in either hardware engines or software engines, the design can be moved to a different set of hardware and software engines residing on a runtime of a different computer system. Second, because the hardware compiler can be configured to generate bit streams for any target FPGA, not all of the FPGAs need to be of the same type. Mixing of different FPGAs from different vendors is possible. Third, the FPGAs available on one computer system can be different on another computer system to which the design is moved.

Certain embodiments as described above involve a hardware abstraction layer on top of a host computer. The hardware abstraction layer allows multiple contexts to share the hardware resource. In one embodiment, these contexts are isolated from each other, each having at least a user application running therein. The hardware abstraction layer thus provides benefits of resource isolation and allocation among the contexts. In the foregoing embodiments, virtual machines are used as an example for the contexts and hypervisors as an example for the hardware abstraction layer. As described above, each virtual machine includes a guest operation system in which at least one application runs. It should be noted that these embodiments may also apply to other examples of contexts, such as containers not including a guest operation system, referred to herein as “OS-less containers” (see, e.g., www.docker.com). OS-less containers implement operating system-level virtualization, wherein an abstraction layer is provided on top of the kernel of an operating system on a host computer. The abstraction layer supports multiple OS-less containers each including an application and its dependencies. Each OS-less container runs as an isolated process in user space on the host operating system and shares the kernel with other containers. The OS-less container relies on the kernel's functionality to make use of resource isolation (CPU, memory, block I/O, network, etc.) and separate namespaces and to completely isolate the application's view of the operating environments. By using OS-less containers, resources can be isolated, services restricted, and processes provisioned to have a private view of the operating system with their own process ID space, file system structure, and network interfaces. Multiple containers can share the same kernel, but each container can be constrained to only use a defined amount of resources such as CPU, memory and I/O.

The various embodiments described herein may be practiced with other computer system configurations including hand-held devices, microprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like.

One or more embodiments of the present invention may be implemented as one or more computer programs or as one or more computer program modules embodied in one or more computer readable media. The term computer readable medium refers to any data storage device that can store data which can thereafter be input to a computer system. Computer readable media may be based on any existing or subsequently developed technology for embodying computer programs in a manner that enables them to be read by a computer. Examples of a computer readable medium include a hard drive, network attached storage (NAS), read-only memory, random-access memory (e.g., a flash memory device), a CD (Compact Discs)—CD-ROM, a CD-R, or a CD-RW, a DVD (Digital Versatile Disc), a magnetic tape, and other optical and non-optical data storage devices. The computer readable medium can also be distributed over a network coupled computer system so that the computer readable code is stored and executed in a distributed fashion.

Although one or more embodiments of the present invention have been described in some detail for clarity of understanding, it will be apparent that certain changes and modifications may be made within the scope of the claims. Accordingly, the described embodiments are to be considered as illustrative and not restrictive, and the scope of the claims is not to be limited to details given herein, but may be modified within the scope and equivalents of the claims. In the claims, elements and/or steps do not imply any particular order of operation, unless explicitly stated in the claims.

Plural instances may be provided for components, operations or structures described herein as a single instance. Finally, boundaries between various components, operations and data stores are somewhat arbitrary, and particular operations are illustrated in the context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within the scope of the invention(s). In general, structures and functionality presented as separate components in exemplary configurations may be implemented as a combined structure or component. Similarly, structures and functionality presented as a single component may be implemented as separate components. These and other variations, modifications, additions, and improvements may fall within the scope of the appended claim(s). 

What is claimed is:
 1. A method for executing a runtime on one or more processors to implement a distributed hardware system, comprising: retrieving from storage a hardware design described in a hardware description language, wherein the hardware design includes a plurality of components; and for each component of the hardware design, sending the component to a hardware compiler and to one of a plurality of software engines, wherein the hardware compiler compiles the component to run in one of a plurality of hardware engines and wherein the one software engine simulates the component while the hardware compiler compiles the component for the one hardware engine; and upon completion of the compilation of the component: sending the compiled component to one of the hardware engines to be executed by the one hardware engine; and monitoring communication so that the one hardware engine can interact with other components in other hardware engines or software engines.
 2. The method of claim 1, wherein the hardware compiler places and routes the component.
 3. The method of claim 2, wherein the hardware compiler performs a timing analysis of the component after placing and routing the component.
 4. The method of claim 1, wherein the hardware compiler generates a bitstream for an FPGA.
 5. The method of claim 4, wherein hardware compiler downloads the bitstream into the FPGA after generating the bitstream.
 6. The method of claim 1, wherein monitoring the one hardware engine includes: receiving communications messages from the one hardware engine; and posting the communications messages in a communications memory in the runtime.
 7. The method of claim 1, wherein the components in the plurality of components are individual components or fused components.
 8. A non-transitory computer readable storage medium for storing instructions that when executed by one or more processors perform a method for implementing a distributed hardware system, the method comprising: retrieving from storage a hardware design described in a hardware description language, wherein the hardware design includes a plurality of components; and for each component of the hardware design: sending the component to a hardware compiler and to one of a plurality of software engines, wherein the hardware compiler compiles the component to run in one of a plurality of hardware engines and wherein the one software engine simulates the component while the hardware compiler compiles the component for the one hardware engine; and upon completion of the compilation of the component: sending the compiled component to one of the hardware engines to be executed by the one hardware engine; and monitoring communication so that the one hardware engine can interact with other components in other hardware engines or software engines.
 9. The non-transitory computer readable storage medium of claim 8, wherein the hardware compiler places and routes the component.
 10. The non-transitory computer readable storage medium of claim 9, wherein the hardware compiler performs a timing analysis of the component after placing and routing the component.
 11. The non-transitory computer readable storage medium of claim 8, wherein the hardware compiler generates a bitstream for an FPGA.
 12. The method of claim 11, wherein hardware compiler downloads the bitstream into the FPGA after generating the bitstream.
 13. The non-transitory computer readable storage medium of claim 8, wherein monitoring the one hardware engine includes: receiving communications messages from the one hardware engine; and posting the communications messages in a communications memory in the runtime.
 14. The non-transitory computer readable storage medium of claim 8, wherein the components in the plurality of components are individual components or fused components.
 15. A computing system for implementing a distributed hardware system, the system comprising: a storage unit containing the distributed hardware system described in a hardware description language; one or more processors coupled to the storage unit; and a memory coupled to the one or more processors and containing runtime software, wherein the runtime, when executed by the one or more processors, carries out the steps of: retrieving from storage a hardware design described in a hardware description language, wherein the hardware design includes a plurality of components; and for each component of the hardware design: sending the component to a hardware compiler and to one of a plurality of software engines, wherein the hardware compiler compiles the component to run in one of a plurality of hardware engines and wherein the one software engine simulates the component while the hardware compiler compiles the component for the one hardware engine; and upon completion of the compilation of the component, sending the compiled component to one of the hardware engines to be executed by the one hardware engine; and monitoring communication so that the one hardware engine can interact with other components in other hardware engines or software engines.
 16. The computing system of claim 15, wherein the hardware compiler places and routes the component.
 17. The computing system of claim 16, wherein the hardware compiler performs a timing analysis of the component after placing and routing the component.
 18. The computing system of claim 15, wherein the hardware compiler generates a bitstream for an FPGA.
 19. The method of claim 18, wherein hardware compiler downloads the bitstream into the FPGA after generating the bitstream.
 20. The computing system of claim 15, wherein monitoring the one hardware engine includes receiving communications messages from the one hardware engine; and posting the communications messages in a communications memory in the runtime. 